package mo.leetcode_top;

import java.util.Random;

public class L470 {

    public int rand10() {

        int first, second;

        while ((first = rand7()) > 6);
        while ((second = rand7()) > 5);

        return (first&1) == 1 ? second : second+5;

    }


    private int rand7() {
        return new Random().nextInt(7) + 1;
    }
}
